<div id="content">
	<div class="row s_page_title">
		<sa-big-breadcrumbs [items]="['系统基础管理','对公账户管理','账单明细']" icon="fa fa-list"
			class="col-xs-12 col-sm-7 col-md-7 col-lg-4"></sa-big-breadcrumbs>
	</div>
	<sa-widgets-grid>
		<div class="s_table">
			<div sa-widget [editbutton]="false" color="darken" class="clearfix">
				<header><span class="widget-icon"> <i class="fa fa-table"></i> </span>
					<h2>账单明细</h2>
				</header>
				<div>
					<div class="widget-body no-padding">
						<div class="page-header clearfix s_table_opreation">
							<div class="left page-header-btn">

								<div class="selectDate top_module">
									<table-select-date
									[startTimePlaceholder]="'选择开始时间'" [endTimePlaceholder]="'选择结束时间'" [specifyId]='specifyId' [specifyTime]='specifyTime' [notInit]="true" (outerTime)="dateSelect($event)" ></table-select-date>
								</div>

								<div class="top_module top_module_box">
									<span class="module_text">车牌号码</span>
									<div class="s_hover_box">
										<select   class="select2"  id="carNumberSelect2">
											<option value=''></option>
										</select>
										<div class="s_del_icon" (click)='del_carNumber()'>x</div>
									</div>
								</div>
								<div class="top_module top_module_box">
									<span class="module_text">设备ID</span>
									<input type="text" class="module_inp top_module_select" [(ngModel)]="tableSearch.deviceId" placeholder="输入设备ID"/>
								</div>
								<div class="top_module top_module_box">
									<span class="module_text">项目名称</span>
									<input type="text" class="module_inp top_module_select" [(ngModel)]="tableSearch.projectName" placeholder="输入项目名称"/>
								</div>
								<div class="top_module">
									<span class="module_text">对接厂区</span>
									<sa-company-tree companyTreeId="companyTree"
									[companyIdValue]="tableSearch.companyId" [companyNameValue]="tableSearch.companyName"
										(companySelected)="companySelected($event)">
									</sa-company-tree>
								</div>

								<div class="top_module top_module_box">
									<span class="module_text">账户名称</span>
									<input type="text" class="module_inp top_module_select" [(ngModel)]="tableSearch.username" placeholder="输入账户名称"/>
								</div>
								<div class="top_module">
									<span class="module_text">账单类型</span>
									<select name="" id="" class="module_inp" [(ngModel)]="tableSearch.billType" (change)="changeBillType()" >
										<option value="">全部</option>
										<option value="1">服务费</option>
										<option value="2">对接费</option>
									</select>
								</div>
								<div class="top_module">
									<span class="module_text">数据来源</span>
									<select name="" id="" class="module_inp" [(ngModel)]="tableSearch.dataSource" (change)="changeDataSource()" >
										<option value="">全部</option>
										<option value="1">批量导入</option>
										<option value="2">随你运小程序</option>
										<option value="3">平台新增</option>
										<option value="4">API接口对接</option>
									</select>
								</div>
								<button class="btn btn-primary" (click)="table_search()">查询</button>
							</div>
						</div>
						<div class="table_scroll">
							<table
								class="display dataTables responsive table table-striped table-bordered table-hover dataTable s_h5_table">
								<thead>
									<tr>
										<th>车牌号</th>
										<th>设备ID</th>
										<th>项目名称</th>
										<th>对接厂区</th>
										<th>账户名称</th>
										<th>账单类型</th>
										<th>账单金额[元]</th>
										<th>数据来源</th>
										<th>创建时间</th>
										<th>创建人</th>
										<th>更新时间</th>
									</tr>
								</thead>
								<tbody>
									<tr *ngFor="let row of tableData">
										<td>{{row.carNumber}}</td>
										<td>{{row.deviceId}}</td>
										<td>{{row.projectName}}</td>
										<td>{{row.companyName}}</td>
										<td>{{row.username}}</td>
										<td>
											<span *ngIf="row.billType == 1">服务费</span>
											<span *ngIf="row.billType == 2">对接费</span>
										</td>
										<td>{{row.billAmount}}</td>
										<td>
											<span *ngIf="row.dataSource == 1">批量导入</span>
											<span *ngIf="row.dataSource == 2">随你运小程序</span>
											<span *ngIf="row.dataSource == 3">平台新增</span>
											<span *ngIf="row.dataSource == 4">API接口对接</span>
										</td>
										<td>{{row.createTime}}</td>
										<td>{{row.createUser}}</td>
										<td>{{row.updateTime}}</td>
									</tr>
								</tbody>
							</table>
						</div>
						<div class="table-fix clearfix">
							<paginator [totalRecords]="totalCount" [rows]="pageSize" [currentPage]="curPage - 1"
								(onPageChange)="paginate($event)">
							</paginator>
							<button type="button" class="btn default refresh_btn" (click)="refresh()"><i
									class="fa fa-refresh"></i></button>
						</div>
					</div>
				</div>
			</div>
		</div>
	</sa-widgets-grid>
</div>